<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>后台管理 - 易买网</title>
    <link type="text/css" rel="stylesheet" href="../css/style.css"/>
    <script type="text/javascript" src="../scripts/function-manage.js"></script>
</head>
<body>
<div class="main">
    <h2>用户管理</h2>
    <div class="manage">
        <table class="list">
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>性别</th>
                <th>Email</th>
                <th>操作</th>
            </tr>

            <c:forEach items="${userList}" var="u">
                <c:choose>
                    <c:when test="${u.userid ne Curr_User.userid}">
                        <tr align="center">
                            <td>${u.userid}</td>
                            <td>${u.username}</td>
                            <td>${u.usersex}</td>
                            <td>${u.useremail}</td>
                            <td><a href="../UserUpdateServlet?userid=${u.userid}">修改&nbsp;| </a><a href="../UserDeleteServlet?userid=${u.userid}" id="userDelete" onclick="return confirmAct(this)">&nbsp;删除</a></td>
                        </tr>
                    </c:when>
                    <c:otherwise>

                    </c:otherwise>
                </c:choose>
            </c:forEach>


            <tr>
                <td colspan="5" align="center">
                    <a href="UserByPageServlet?pageIndex=1">首页</a>|
                    <a href="UserByPageServlet?pageIndex=${pageIndex-1}">上一页</a>|
                    <a href="UserByPageServlet?pageIndex=${pageIndex+1}">下一页</a>|
                    <a href="UserByPageServlet?pageIndex=${totalPages}">尾页</a>
                </td>
            </tr>
        </table>
    </div>
</div>
</body>
</html>
<script>
    function confirmAct() {
        if (confirm('确定要执行此操作吗?')) {
            return true;
        }
        return false;
    }
</script>
